import { createCrudApi } from '../factories/createCrudApi'
import type { Property, PropertyCreate, PropertyUpdate } from '../types'

/**
 * 房源筛选参数
 */
interface PropertyFilter {
  community_name?: string
  status?: string
  min_price?: number
  max_price?: number
  [key: string]: unknown
}

/**
 * 房源管理 API
 * 使用 createCrudApi 工厂快速生成标准 CRUD 方法
 */
export const propertyApi = createCrudApi<Property, PropertyCreate, PropertyUpdate, PropertyFilter>(
  'v1/properties/'
)
